<?php

namespace common\models;

use common\base\BaseBackendActiveRecord;
use yii\base\Model;

/**
 * This is the model class for table "circuit_address".
 *
 * @property int $id 自增
 * @property int $site_id 站点id
 * @property int $circuit_id 路线id
 * @property string $address 地址
 * @property int $type 类型 1上车 2下车
 * @property int $is_del 是否删除
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class CircuitAddress extends BaseBackendActiveRecord
{
    const IS_DEL_NO = 1;
    const IS_DEL_YES = 2;

    const TYPE_GETON=1;//上车
    const TYPE_GETOFF=2;//下车
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'circuit_address';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['address'], 'string'],
            [['created_at','updated_at'], 'safe'],
            [['circuit_id', 'is_del','type','site_id'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '自增',
            'address' => '地址',
            'circuit_id' => 'circuit_id',
            'is_del' => 'is_del',
            'type'=>'type',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'site_id'=>'站点id'
        ];
    }
}
